<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="<%= window.location.href %>">每日利润数据</a>
            </li>
        </ol>
    </div>
</header>
<section id="content">
<div class="panel">
    <form class="form-horizontal">
        <div class="form-group">
            <div class="col-md-11">
                <input type="text" id="dateFilter" name="dateFilter" class="form-control text-center" value="<%= options.dateRange['0'] %> ~ <%= options.dateRange['1'] %>">
            </div>
            <div class="col-md-1">
                <input type="button" id="search" class="btn btn-primary btn-block form-control" value="提交">
            </div>
        </div>
    </form>
</div>

<div class="panel overflow">
    <div class="panel-heading">
        <span class="panel-icon"><i class="fa fa-gear text-primary"></i>
        </span>
        <span class="panel-title">走势曲线</span>
    </div>
    <div class="panel-body">
        <div id="chart_recharge"></div>
        <div id="chart_profit"></div>
        <div id="chart_gain"></div>
    </div>
</div>

<div class="panel overflow">
    <div class="panel-heading">
        <span class="panel-icon"><i class="fa fa-gear text-primary"></i>
        </span>
        <span class="panel-title">数据表格</span>
    </div>
    <div class="panel-body">
        <table class="table table-striped fs13">
            <thead>
                <tr class="bg-light">
                    <th>日期</th>
                    <th>充值金额</th>
                    <th>提现金额</th>
                    <th>实际利润</th>
                    <th>实际利润率</th>
                    <th>实际购彩金额</th>
                    <th>购彩中奖金额</th>
                    <th>购彩抽水金额</th>
                    <th>购彩抽水率</th>
                    <th>红包使用</th>
                    <th>系统上分</th>
                    <th>电参与金额</th>
                    <th>电中奖金额</th>
                    <th>电抽水</th>
                    <th>电抽水率</th>
                    <th>metis参与</th>
                    <th>metis中奖</th>
                    <th>metis抽水</th>
                    <th>metis抽水率</th>
                    <th>整体抽水</th>
                </tr>
            </thead>
            <tbody class="admin-form">

                <% _.each(items, function(item){ %>
                    <tr>
                        <td><%= item._id %></td>
                        <th><%= ((item.recharge_price || 0) / 100).toFixed(2) %></th>
                        <td><%= ((item.withdraw_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.realProfit || 0) / 100).toFixed(2) %></td>
                        <td><%= (item.realProfit_ratio * 100 || 0).toFixed(2) %>%</td>
                        <td><%= ((item.realPay_price || 0) / 100).toFixed(2)  %></td>
                        <td><%= ((item.realWin_price || 0) / 100).toFixed(2) %></td>
                        <td><%= ((item.realGain || 0) / 100).toFixed(2) %></td>
                        <td><%= (item.realGain_ratio * 100 || 0).toFixed(2) %>%</td>
                        <th><%= ((item.coupon_use || 0) / 100).toFixed(2) %></th>
                        <th><%= ((item.system_recharge_price || 0) / 100).toFixed(2) %></th>
                        <td><%= ((item.real_dwc_payprice || 0) / 100).toFixed(2) %></td>
                        <th><%= ((item.real_dwc_winprice || 0) / 100).toFixed(2) %></th>
                        <td><%= ((item.real_dwc_gain) / 100).toFixed(2) %></td>
                        <td><%= (item.real_dwc_gain_ratio * 100).toFixed(2) %>%</td>
                        <td><%= ((item.real_metis_payprice || 0) / 100).toFixed(2) %></td>
                        <th><%= ((item.real_metis_winprice || 0) / 100).toFixed(2) %></th>
                        <td><%= ((item.real_metis_gain || 0) / 100).toFixed(2) %></td>
                        <td><%= (item.real_metis_gain_ratio * 100).toFixed(2) %>%</td>
                        <td><%= ((item.totalGain) / 100).toFixed(2) %></td>
                    </tr>
                <% }) %>
                <tr>
                    <% if(sum.length > 0){ %>
                    <td>总计</td>
                    <th><%= ((sum.recharge_price || 0) / 100).toFixed(2) %></th>
                    <td><%= ((sum.withdraw_price || 0) / 100).toFixed(2) %></td>
                    <td><%= ((sum.realProfit || 0) / 100).toFixed(2) %></td>
                    <td><%= (sum.realProfit_ratio * 100 || 0).toFixed(2) %>%</td>
                    <td><%= ((sum.realPay_price || 0) / 100).toFixed(2)  %></td>
                    <td><%= ((sum.realWin_price || 0) / 100).toFixed(2) %></td>
                    <td><%= ((sum.realGain || 0) / 100).toFixed(2) %></td>
                    <td><%= (sum.realGain_ratio * 100 || 0).toFixed(2) %>%</td>
                    <td><%= ((sum.real_dwc_payprice || 0) / 100).toFixed(2) %></td>
                    <th><%= ((sum.real_dwc_winprice || 0) / 100).toFixed(2) %></th>
                    <td><%= ((sum.real_dwc_gain) / 100).toFixed(2) %></td>
                    <td><%= (sum.real_dwc_gain_ratio * 100).toFixed(2) %>%</td>
                    <td><%= ((sum.real_metis_payprice || 0) / 100).toFixed(2) %></td>
                    <th><%= ((sum.real_metis_winprice || 0) / 100).toFixed(2) %></th>
                    <td><%= ((sum.real_metis_gain || 0) / 100).toFixed(2) %></td>
                    <td><%= (sum.real_metis_gain_ratio * 100).toFixed(2) %>%</td>
                    <td><%= ((sum.totalGain) / 100).toFixed(2) %></td>
                </tr>
                <% } %>


            </tbody>
        </table>
    </div>
</div>
</section>
